(global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/wk-login-modal/index" ], {
    50069: function(t, n, s) {
        (function(i) {
            function e(e, t) {
                var o, n = Object.keys(e);
                return Object.getOwnPropertySymbols && (o = Object.getOwnPropertySymbols(e), t && (o = o.filter(function(t) {
                    return Object.getOwnPropertyDescriptor(e, t).enumerable;
                })), n.push.apply(n, o)), n;
            }
            function t(n) {
                for (var t = 1; t < arguments.length; t++) {
                    var i = null != arguments[t] ? arguments[t] : {};
                    t % 2 ? e(Object(i), !0).forEach(function(t) {
                        var e, o;
                        e = n, t = i[o = t], o in e ? Object.defineProperty(e, o, {
                            value: t,
                            enumerable: !0,
                            configurable: !0,
                            writable: !0
                        }) : e[o] = t;
                    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(i)) : e(Object(i)).forEach(function(t) {
                        Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(i, t));
                    });
                }
                return n;
            }
            Object.defineProperty(n, "__esModule", {
                value: !0
            });
            var o = {
                name: "wkLoginModal",
                components: {},
                data: function() {
                    return {
                        session_key: "",
                        btn_show: 1,
                        token: "",
                        user: {}
                    };
                },
                props: {},
                created: function() {
                    this.init();
                },
                computed: t(t({}, (n.default = void 0, s("26cb").mapState)({
                    showLoginTip: function(t) {
                        return t.user.showLoginTip;
                    }
                })), {}, {
                    showModal: {
                        get: function() {
                            return this.showLoginTip && (i.login({
                                success: function(t) {}
                            }), this.btn_show = 1), this.showLoginTip;
                        },
                        set: function(t) {
                            this.$store.commit("LOGIN_TIP", t);
                        }
                    }
                }),
                methods: {
                    init: function() {},
                    hide: function() {
                        this.showModal = !1;
                    },
                    show: function() {
                        this.showModal = !0;
                    },
                    phoneLogin: function() {
                        this.$Router.push({
                            path: "/pages/public/login"
                        });
                    },
                    getUserInfo: function() {
                        var n = this, o = i.getStorageSync("share_uid") ? i.getStorageSync("share_uid") : 0;
                        i.getUserProfile({
                            desc: "获取用户头像昵称",
                            success: function(t) {
                                var e = t.userInfo;
                                i.login({
                                    success: function(t) {
                                        n.$api("index.wx_login", {
                                            code: t.code,
                                            nickname: e.nickName,
                                            avatarurl: e.avatarUrl,
                                            share_uid: o
                                        }, "post").then(function(t) {
                                            var e, o;
                                            0 == t.errno && (0 == t.data.code ? (e = t.data.user, o = t.data.token, n.$tools.toast("登录成功"), 
                                            n.$store.commit("isLogin", !0), n.showModal = !1, n.$store.commit("loginUser", e), 
                                            i.setStorageSync("token", o), setTimeout(function() {
                                                n.$Router.pushTab("/pages/index/index");
                                            }, 800)) : 1 == t.data.code ? (n.btn_show = 2, n.token = t.data.token, n.user = t.data.user, 
                                            n.session_key = t.data.session_key) : n.$tools.toast(t.data.msg));
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                console.info(t);
                            }
                        });
                    },
                    getphonenumber: function(t) {
                        var e = this;
                        "getPhoneNumber:ok" == t.detail.errMsg && (console.info(t), e.$api("index.bind_phone", {
                            code: t.detail.code,
                            user_id: e.user.id
                        }, "post").then(function(t) {
                            0 == t.errno ? 0 == t.data.code ? (e.$tools.toast("登录成功"), e.$store.commit("isLogin", !0), 
                            e.showModal = !1, e.$store.commit("loginUser", t.data.user), i.setStorageSync("token", e.token), 
                            setTimeout(function() {
                                e.$Router.pushTab("/pages/index/index");
                            }, 500)) : e.$tools.toast(t.data.msg) : e.$tools.toast(t.msg);
                        }).catch(function(t) {
                            i.showModal({
                                title: "错误",
                                content: "错误：" + t
                            });
                        }));
                    }
                }
            };
            n.default = o;
        }).call(this, s("543d").default);
    },
    "73d4": function(t, e, o) {
        o.r(e);
        var n, i = o("50069"), s = o.n(i);
        for (n in i) "default" !== n && function(t) {
            o.d(e, t, function() {
                return i[t];
            });
        }(n);
        e.default = s.a;
    },
    8387: function(t, e, o) {
        var n = o("f03c");
        o.n(n).a;
    },
    "978a": function(t, e, o) {
        o.r(e);
        var n, i = o("a3dc"), s = o("73d4");
        for (n in s) "default" !== n && function(t) {
            o.d(e, t, function() {
                return s[t];
            });
        }(n);
        o("8387");
        var a = o("f0c5"), i = Object(a.a)(s.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        e.default = i.exports;
    },
    a3dc: function(t, e, o) {
        o.d(e, "b", function() {
            return n;
        }), o.d(e, "c", function() {
            return i;
        }), o.d(e, "a", function() {});
        var n = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    },
    f03c: function(t, e, o) {}
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/wk-login-modal/index-create-component", {
    "components/wk-login-modal/index-create-component": function(t, e, o) {
        o("543d").createComponent(o("978a"));
    }
}, [ [ "components/wk-login-modal/index-create-component" ] ] ]);